<?php

use App\Models\User;
use Illuminate\Support\Facades\Broadcast;

Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
    return (int)$user->id === (int)$id;
});

Broadcast::channel('chat.{roomId}', function (User $user, int $roomId) {
    if ($user->id >= 1) {
        return ['id' => $user->id, 'name' => $user->name];
    }
});

